/**
  * Copyright (c) CSIRO Australia, 2009
  *
  * @author $Author: jia020 $
  * @version $Id: PDQueryService.java 643 2009-05-20 00:20:55Z jia020 $
  */
package au.csiro.nt.pdsp.client;

import java.util.Map;

import com.google.gwt.user.client.rpc.AsyncCallback;
import com.google.gwt.user.client.rpc.RemoteService;
import com.google.gwt.user.client.rpc.RemoteServiceRelativePath;

/**
 * The client side stub for the RPC service.
 */
@RemoteServiceRelativePath("pdquery")
public interface PDQueryService extends RemoteService {
	/**
	 * RPC call for Querying privacy data according to formdata.
	 * @param formData criterials for query.
	 * @return XML formated privacy data.
	 */		
	String queryServer(Map formData);
	/**
	 * RPC call to Save the task(a confirmed query from 3party organisation user) to task queue.
	 * @param userid user's id for task.
	 * @param taskBase64 base64 encoded SQL query.
	 * @param task description.
	 * @return boolean to indicate the success of rpc call.
	 */		
	boolean saveTask(String userid,String taskBase64,String description);	
	/**
	 * RPC call for Tasks retrieving based on userid.
	 * @param userid userid for tasks retrieving.
	 * @return xml formated tasks data.
	 */	
	String getMyTasks(String userid);
	/**
	 * RPC call for Workflows retrieving based on taskid.
	 * @param taskid taskid for Workflows retrieving.
	 * @return xml formated workflows data.
	 */		
	String getMyWorkflows(int taskid);
	/**
	 * RPC call for Unreviewed Workflows retrieving.
	 * @return xml formated workflows data.
	 */		
	String getUnreviewedWorkflows();
	/**
	 * RPC call for Workflows retrieving.
	 * @param type the type of Workflows.
	 * @param param for retrieving.
	 * @return xml formated workflows data.
	 */		
	String getWorkflows(int type,int param);
	/**
	 * RPC call for a Workflow reviewing.
	 * @param workflowid workflowid for reviewing.
	 * @return boolean to indicate the success of rpc call.
	 */		
	boolean reviewWorkflow(int workflowid);
	/**
	 * RPC call for user authentication.
	 * @param username user's id .
	 * @param password user's password.
	 * @return xml params for authenticated user.
	 */		
	String login(String username,String password);
	/**
	 * RPC call for retrieving user's messages.
	 * @param userid user's id for messages retrieving.
	 * @return XML formated messages data for user.
	 */		
	String getMyMessages(String userid);
	/**
	 * RPC call for sending a reply message.
	 * @param imsID for the reply message.
	 * @param message for sending.
	 * @return boolean to indicate the success of rpc call.
	 */		
	boolean sendMessage(int imsID, String message);
	/**
	 * RPC call for PDSP service subscription.
	 * @param username user's id to subscribe.
	 * @param subscribe subscribe or unsubscribe.
	 * @return boolean to indicate the success of rpc call.
	 */		
	boolean subscribePDSP(String username,boolean subscribe);
	
}
